import Vue from "vue";

//1.引入Element UI 组件库 和 样式
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import App from "./App.vue";
import router from "./router";
import store from "./store";
import VeLine from 'v-charts/lib/line.common'
import axios from 'axios'
import qs from 'qs'
// 导入mockjs
// import './mock/mock'
// import './mock/index'
//2.使用Element UI
Vue.use(ElementUI);

Vue.config.productionTip = false;
Vue.component(VeLine.name, VeLine)

Vue.prototype.qs = qs;
Vue.prototype.axios = axios;
axios.interceptors.request.use((config) => {
  let token = sessionStorage.getItem("token");
  config.headers['Authorization'] = token;

  return config;
}, (error) => {
  return Promise.reject(error);
});


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");